<template>

  <form>
      <label>Username:</label>
      <input type="text" id="username" name="username" v-model="loginForm.username">
      <br>
      <br>
      <label>
        Password:
      </label>
      <input type="password" id="password" name="password" v-model="loginForm.password">
      <br>
      <br>
      <input type="submit" value="Submit" @click="validate">
    </form>

<counter/>
</template>
<script>
import counter from './components/counter.vue'

   export default {

    components: {
    counter
  },


    data() {
      return {
        loginForm:{
          username:"",
          password:"",
        },
      }
    },
  methods:{
    validate(){
      if(this.loginForm.username == "dd" && this.loginForm.password == "1234"){
        alert('登录成功');
      }else{
        alert("密码错误");
      }
    }
  }}
</script>
